# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=sooty
pkgver=335.6236fd1
pkgrel=4
pkgdesc='The SOC Analysts all-in-one CLI tool to automate and speed up workflow.'
groups=('blackarch' 'blackarch-defensive' 'blackarch-recon' 'blackarch-social')
arch=('any')
url='https://github.com/TheresAFewConors/Sooty'
license=('custom:unknown')
depends=('python' 'python-asn1crypto' 'python-certifi' 'python-cffi'
         'python-chardet' 'python-dnspython' 'python-idna' 'python-ipwhois'
         'python-pycparser' 'python-requests' 'python-six' 'python-urllib3'
         'python-win_inet_pton' 'python-pysocks' 'python-pyopenssl'
         'python-cryptography' 'python-wincertstore' 'python-strictyaml'
         'python-wget' 'python-unfurl' 'tk')
makedepends=('git')
source=("$pkgname::git+https://github.com/TheresAFewConors/Sooty.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md

  rm README.md

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python Sooty.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

